package com.automannn.atm_back.modules.system.service.impl;

import com.automannn.atm_back.modules.system.entity.SysAnnouncementSend;
import com.automannn.atm_back.modules.system.mapper.SysAnnouncementSendMapper;
import com.automannn.atm_back.modules.system.model.AnnouncementSendModel;
import com.automannn.atm_back.modules.system.service.ISysAnnouncementSendService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author chenkh
 * @time 2020/6/26 22:13
 */
@Service
public class SysAnnouncementSendServiceImpl extends ServiceImpl<SysAnnouncementSendMapper, SysAnnouncementSend> implements ISysAnnouncementSendService {
    @Resource
    private SysAnnouncementSendMapper sysAnnouncementSendMapper;

    @Override
    public List<String> queryByUserId(String userId) {
        return sysAnnouncementSendMapper.queryByUserId(userId);
    }

    @Override
    public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page,
                                                                 AnnouncementSendModel announcementSendModel) {
        return page.setRecords(sysAnnouncementSendMapper.getMyAnnouncementSendList(page, announcementSendModel));
    }
}
